package com.example.net;

import com.example.domain.Girls;

import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2016/5/26.
 */
public class Retrofit {
    private static retrofit2.Retrofit retrofit;
    public static retrofit2.Retrofit getRetrofit(){
        if (retrofit == null){
            synchronized (Retrofit.class){
                if (retrofit == null){
                    retrofit = new retrofit2.Retrofit.Builder()
                            .baseUrl(Girls.BASEURL)
                            .addConverterFactory(GsonConverterFactory.create())
                            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                            .build();
                }
            }
        }
        return retrofit;
    }
}
